package com.evan.common.bit;

public enum ZkServerStatus {

    ONLINE("online"),
    OFFLINE("offline"),
    UNKNOWN("unknown"),
    EXCEPTION("exception"),
    ;


    private String val;

    ZkServerStatus(String val) {
        this.val = val;
    }

    public String getVal() {
        return val;
    }


    public String getString(String val){
        return val.toString();
    }

    public ZkServerStatus getInstance(String val){
        for (ZkServerStatus bit : ZkServerStatus.values()) {
            if(bit.getVal().equals(val)){
                return bit;
            }
        }
        return null;
    }
}
